<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Title</title>
    <link rel="stylesheet" th:href="@{assets/css/core.css}"/>
    <link rel="stylesheet" th:href="@{assets/css/amazeui.css}"/>
    <link rel="stylesheet" th:href="@{assets/css/menu.css}"/>
    <link rel="stylesheet" th:href="@{assets/css/index.css}"/>
    <link rel="stylesheet" th:href="@{assets/css/admin.css}"/>
    <link rel="stylesheet" th:href="@{assets/css/page/typography.css}"/>
    <link rel="stylesheet" th:href="@{assets/css/page/form.css}"/>
    <link rel="stylesheet" th:href="@{assets/css/component.css}"/>

    <link rel="stylesheet" th:href="@{http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css}">
    <link rel="stylesheet" th:href="@{https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css}">
    <script th:src="@{https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js}"></script>
    <script th:src="@{https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js}"></script>



    <!-- Favicons -->
    <link rel="icon" th:href="@{img/favicon.png}"/>
    <link rel="apple-touch-icon" th:href="@{img/apple-touch-icon.png}"/>

    <!-- Bootstrap core CSS -->
    <link rel="stylesheet" th:href="@{lib/bootstrap/css/bootstrap.min.css}"/>

    <!--external css-->
    <link rel="stylesheet" th:href="@{lib/font-awesome/css/font-awesome.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{css/zabuto_calendar.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{lib/gritter/css/jquery.gritter.css}"/>

    <link rel="stylesheet" th:href="@{css/style.css}"/>
    <link rel="stylesheet" th:href="@{css/style-responsive.css}"/>
    <script th:src="@{lib/chart-master/Chart.js}"></script>



</head>
<body>
<section id="container">
    <!--header start-->
    <header class="header black-bg" th:replace="headBar::myHeadBar">
    </header>
    <!--header end-->

    <!--sidebar start-->
    <aside th:replace="leftSideBar::myLeftBar">
    </aside>
    <!--sidebar end-->

    <!--main content start-->
    <section id="main-content">
        <section class="wrapper">
            <h3><i class="fa fa-angle-right"></i> 更新权限</h3>
            <!-- BASIC FORM VALIDATION -->
            <div class="row mt">
                <div class="col-lg-12">
                    <!--<h4><i class="fa fa-angle-right"></i> Basic Validations</h4>-->
                    <div class="form-panel">

                        <form role="form" class="form-horizontal style-form">
                            <div class="form-group has-success">
                                <label class="col-lg-2 control-label">用户名：</label>
                                <div class="col-lg-10">
                                    <input  type="text" id="doc-ds-ipt-1"  th:value="${updateUser.username}" class="form-control" disabled>

                                </div>
                            </div>


                            <div class="form-group has-warning">
                                <div class="am-form-group">
                                    <label class="am-form-label col-lg-2 control-label">主题权限：</label>
                                    <label class="am-checkbox-inline col-lg-2">
                                        <input type="checkbox"  value="add" name="SchemePermission" th:checked="${addstr!=add}"> 上传
                                    </label>
                                    <label class="am-checkbox-inline col-lg-2">
                                        <input type="checkbox" value="delete" name="SchemePermission" th:checked="${deletestr!=delete}"> 删除
                                    </label>
                                    <label class="am-checkbox-inline col-lg-2">
                                        <input type="checkbox" value="search" name="SchemePermission" th:checked="${searchstr!=search}"> 查看
                                    </label>
                                    <label class="am-checkbox-inline col-lg-2">
                                        <input type="checkbox"  value="download" name="SchemePermission" th:checked="${downloadstr!=download}"> 下载
                                    </label>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-lg-offset-2 col-lg-10">
                                    <button class="btn btn-theme" id="saveUser" type="button"
                                            th:onclick="subcfm()">提交
                                    </button>
                                </div>
                            </div>
                        </form>

                    </div>
                    <!-- /form-panel -->
                </div>
                <!-- /col-lg-12 -->
            </div>
            <!-- /row -->


        </section>
        <!-- /wrapper -->
    </section>


    <!-- /MAIN CONTENT -->
    <!--main content end-->

</section>











<!-- navbar -->
<a th:href="@{admin-offcanvas}" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu"
   data-am-offcanvas="{target: '#admin-offcanvas'}"><!--<i class="fa fa-bars" aria-hidden="true"></i>--></a>

<script type="text/javascript" th:src="@{assets/js/jquery-2.1.0.js}"></script>
<!--<script type="text/javascript" th:src="@{assets/js/app.js}"></script>-->
<script type="text/javascript" th:src="@{assets/js/blockUI.js}"></script>
<!--<script type="text/javascript" th:src="@{assets/js/charts/echarts.min.js}"></script>
<script type="text/javascript" th:src="@{assets/js/charts/indexChart.js}"></script>-->
<script type="text/javascript" th:src="@{assets/js/amazeui.min.js}"></script>

<!--修改主题权限-->
<script type="text/javascript" th:inline="javascript">

    $("#saveUser").click(function(){
        var v=[];
        var username=$("#doc-ds-ipt-1").val();
        $(":checkbox[name='SchemePermission']:checked").each(function(){
            v.push($(this).val());
        });
        var URL=[[@{/saveU}]];
            $.ajax({
                type:"get",
                url:URL,
                data : {checkValue: v.toString(),
                    username:username
                },
                success:function (data) {
                    if(0<parseInt(data)){
                        alert("修改成功");
                        window.location.href = "/user";
                    }
                    console.log(data);
                }
            });
    });
</script>


<script type="text/javascript" th:inline="javascript">
    $(function(){
        var URL=[[@{/headPic}]];
            $.ajax({
                type:"get",
                url:URL,
                data : {
                },
                success:function (data) {
                    console.log(data);
                    $("#headPic").attr("src", "data:image/gif;base64," + data);
                }
            });
        });


</script>


<!--验证登陆者的主题主题上传权限-->

<script type="text/javascript" th:inline="javascript">
    $(function () {
        var URL = [[@{/checkPermission}]];
            var add="上传";
            $.ajax({
                type: "get",
                url: URL,
                data: {
                    action:add
                },
                success: function (data) {
                    console.log(data);
                    if (0 < parseInt(data)) {
                        $("#uploadTheme").show();
                    } else {

                        $("#uploadTheme").hide();
                    }
                }
            });
        }
    )


</script>

<!--验证登陆者的主题主题查看权限-->

<script type="text/javascript" th:inline="javascript">
    $(function () {
        var URL = [[@{/checkPermission}]];
            var view="查看";
            $.ajax({
                type: "get",
                url: URL,
                data: {
                    action:view
                },
                success: function (data) {
                    console.log(data);
                    if (0 < parseInt(data)) {
                        $("#viewTheme").show()
                    } else {

                        $("#viewTheme").hide()
                    }
                }
            });
        }
    )


</script>


<!--验证角色-->
<script type="text/javascript" th:inline="javascript">
    $(function () {
        var URL = [[@{
            /checkRole}]];
            $.ajax({
                type: "get",
                url: URL,
                data: {},
                success: function (data) {
                    console.log(data);
                    if (0 < parseInt(data)) {
                        var url = [[@{/user}]]
                            $("#myUser").html('<a href="'+url+'" >\n' +
                                '                        <i class="fa fa-desktop"></i>\n' +
                                '                        <span >用户管理</span>\n' +
                                '                    </a>');
                            // $("#userManager").show();
                        } else {
                            // $("#userManager").hide();
                        }
                    }
                });
        }
    )


</script>





<!-- js placed at the end of the document so the pages load faster -->
<script th:src="@{lib/jquery/jquery.min.js}"></script>

<script th:src="@{lib/bootstrap/js/bootstrap.js}"></script>
<script class="include" type="text/javascript" th:src="@{lib/jquery.dcjqaccordion.2.7.js}"></script>
<script th:src="@{lib/jquery.scrollTo.min.js}"></script>
<script th:src="@{lib/jquery.nicescroll.js}" type="text/javascript"></script>
<script th:src="@{lib/jquery.sparkline.js}"></script>
<!--common script for all pages-->
<script th:src="@{lib/common-scripts.js}"></script>
<script type="text/javascript" th:src="@{lib/gritter/js/jquery.gritter.js}"></script>
<script type="text/javascript" th:src="@{lib/gritter-conf.js}"></script>
<!--script for this page-->
<script th:src="@{lib/sparkline-chart.js}"></script>
<script th:src="@{lib/zabuto_calendar.js}"></script>
<<!--script type="text/javascript" th:inline="javascript">
    $(document).ready(function () {
        var unique_id = $.gritter.add({
            // (string | mandatory) the heading of the notification
            title: 'Welcome to Dashio!',
            // (string | mandatory) the text inside the notification
            text: 'Hover me to enable the Close Button. You can hide the left sidebar clicking on the button next to the logo.',
            // (string | optional) the image to display on the left
            image: 'img/ui-sam.jpg',
            // (bool | optional) if you want it to fade out on its own or just sit there
            sticky: false,
            // (int | optional) the time you want it to be alive for before fading out
            time: 8000,
            // (string | optional) the class name you want to apply to that specific message
            class_name: 'my-sticky-class'
        });

        return false;
    });
</script>
<script type="application/javascript" th:inline="javascript">
    $(document).ready(function () {
        $("#date-popover").popover({
            html: true,
            trigger: "manual"
        });
        $("#date-popover").hide();
        $("#date-popover").click(function (e) {
            $(this).hide();
        });

        $("#my-calendar").zabuto_calendar({
            action: function () {
                return myDateFunction(this.id, false);
            },
            action_nav: function () {
                return myNavFunction(this.id);
            },
            ajax: {
                url: "show_data.php?action=1",
                modal: true
            },
            legend: [{
                type: "text",
                label: "Special event",
                badge: "00"
            },
                {
                    type: "block",
                    label: "Regular event",
                }
            ]
        });
    });

    function myNavFunction(id) {
        $("#date-popover").hide();
        var nav = $("#" + id).data("navigation");
        var to = $("#" + id).data("to");
        console.log('nav ' + nav + ' to: ' + to.month + '/' + to.year);
    }
</script>-->
</body>
</html>